package com.own.compoent.mq.rabbit.producer.init;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.UUID;

/**
 * InitRabbitQueue
 *
 * @author chenxueli
 * @date 2023-07-24 14:55:00
 */
@RestController
public class InitRabbitQueue {

    @Resource
    private RabbitTemplate rabbitTemplate;

    @GetMapping("send/test")
    public String sendTest() {
        rabbitTemplate.convertAndSend("fanout.exchange", "", UUID.randomUUID().toString());
        return "success";
    }

}
